﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace AbpToDomain.EntityInfo
{
    public class CusetomOrder:Entity
    {
        [Key]
        public Guid CusetomOrder_Id { get; set; }
        public string? hSerial {  get; set; }
        public string? moCode {  get; set; }
        public string? So {  get; set; }
        public string? State {  get; set; }
        public DateTime? CreateTime { get; set; }
        public DateTime? UpdateTime { get; set; }
        //forignkey
        public List<CusetomOrderLine>? cusetomOrderLines { get; set; }
        public override object[] GetKeys()
        {
            return new object[] { CusetomOrder_Id };
        }
        //function
        public CusetomOrder AddCusetomOrder(string hSerial, string moCode,string so)
        {
            CusetomOrder cusetomOrder = new CusetomOrder();
            cusetomOrder.hSerial = hSerial;
            cusetomOrder.moCode = moCode;
            cusetomOrder.State = "未分配";
            cusetomOrder.So = so;
            cusetomOrder.CreateTime = DateTime.Now;
            return cusetomOrder;
        }
    }
    public class CusetomOrderLine : Entity
    {
        [Key]
        public Guid CusetomOrderLine_Id { get; set; }
        public string reelId {  get; set; }
        public string quantity {  get; set; }
        public string slotNum {  get; set; }
        public string? State { get;set; }
        public string? mtrlCode {  get; set; }
        //forignkey
        public CusetomOrder CusetomOrder { get; set; }
        public override object[] GetKeys()
        {
            return new object[] { CusetomOrderLine_Id };
        }
        //function
        public CusetomOrderLine AddCusetomOrderLine(string reelId, string quantity,string slotNum,string mtrlCode)
        {
            CusetomOrderLine cusetomOrderLine = new CusetomOrderLine();
            cusetomOrderLine.reelId = reelId;
            cusetomOrderLine.quantity = quantity;
            cusetomOrderLine.slotNum = slotNum;
            cusetomOrderLine.mtrlCode = mtrlCode;
            return cusetomOrderLine;
        }
    }
}
